﻿@model IEnumerable<KCMS.BusinessLogic.Models.Product>
@{
    ViewBag.Title = "Товары";
}
<h2>
    Index</h2>
<p>
    @Html.ActionLink("Create New", "Create")
</p>
<p>
    @Html.DropDownList("categories", null, new { @id = "drop-down-list-filter" })
    <script type="text/javascript">
        $(document).ready(function () {
            $("#drop-down-list-filter").live("change", function () {
                Filtr($(this), '@Url.Action("GetByCategory", "Product")' + '?categoryId=', '#product-list');
            });
        });
    </script>
</p>
@Ajax.ActionLink("Только неопубликованные", "GetNotPublic",null, new AjaxOptions { UpdateTargetId = "ajax-product-list" }, new { @class="button"})
@using (Ajax.BeginForm("GetByArticle", "Product", new AjaxOptions { UpdateTargetId = "ajax-product-list", HttpMethod = "POST" }))
{
    <text>Артикул</text>
    @Html.TextBox("article")
    <input type="submit" value="Поиск" />
    <div id="ajax-product-list">
        @Html.Partial("_ProductList", Model)
    </div>
}
